/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
  useTheme, CCell, Table, TableBody, TableRow, Text,
} from "customize-easy-ui-component";
import { DirectLink, } from "../../../routing/Link";
import {getInstrument2xCol, } from "../../common/helper";


/**正式报告用的
 * */
export const 报告设备详情= ( { orc,  repId, verId, rep } : { orc: any,repId: string,verId: string,rep:any}
) => {
  const theme= useTheme();
  const instrumentTable =React.useMemo(() => getInstrument2xCol(orc.仪器表), [orc.仪器表]);
  return <React.Fragment>
      <Table id={'Survey'} fixed={ ["17%","%","19%","9%","20%"] }  css={ {borderCollapse: 'collapse' } }  tight  miniw={800}>
        <TableBody>
          <DirectLink  href={`/report/VALV-OF/ver/${verId}/${repId}/Survey#Survey`}>
            <TableRow>
              <CCell>使用单位</CCell>
              <CCell colSpan={2}>{orc.使用单位 || '／'}</CCell>
              <CCell>联系电话</CCell>
              <CCell>{orc.安管电话 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>单位地址</CCell>
              <CCell colSpan={2}>{orc.使用单位地址 || '／'}</CCell>
              <CCell>联系人</CCell>
              <CCell>{orc.安管人员 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>设备代码</CCell>
              <CCell>{orc.设备代码 || '／'}</CCell>
              <CCell>设备安装位置</CCell>
              <CCell colSpan={2}>{orc.设备位置 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>所在设备名称</CCell>
              <CCell>{orc.所在设备 || '／'}</CCell>
              <CCell>所在设备编号</CCell>
              <CCell colSpan={2}>{orc.所在设备号 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>设备工作压力</CCell>
              <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                  <Text >{orc.设备压力 || '／'}</Text>
                  <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                    MPa</Text></div></CCell>
              <CCell>设备工作介质</CCell>
              <CCell colSpan={2}>{orc.设备介质 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>安全阀类型</CCell>
              <CCell>{orc.阀类型 || '／'}</CCell>
              <CCell>安全阀安装位置</CCell>
              <CCell colSpan={2}>{orc.阀安装位 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>制造单位名称</CCell>
              <CCell>{orc.制造单位 || '／'}</CCell>
              <CCell>安全阀型号</CCell>
              <CCell colSpan={2}>{orc.阀型号 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>公称通径</CCell>
              <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                <Text >{orc.公称通径 || '／'}</Text>
                <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                  mm</Text></div></CCell>
              <CCell>校验介质</CCell>
              <CCell colSpan={2}>{orc.验介质 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>公称压力</CCell>
              <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                <Text >{orc.公称压力 || '／'}</Text>
                <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                  MPa</Text></div></CCell>
              <CCell>校验方式</CCell>
              <CCell colSpan={2}>{orc.验方式 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>委托整定压力</CCell>
              <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                <Text >{orc.委整定压 || '／'}</Text>
                <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                  MPa</Text></div></CCell>
              <CCell>校验装置编号</CCell>
              <CCell colSpan={2}>{orc.校验装号 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>实际整定压力</CCell>
              <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                <Text >{orc.实整定压 || '／'}</Text>
                <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                  MPa</Text></div></CCell>
              <CCell>校验装置名称</CCell>
              <CCell colSpan={2}>{orc.校验装 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>密封试验压力</CCell>
              <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                <Text >{orc.密试验压 || '／'}</Text>
                <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                  MPa</Text></div></CCell>
              <CCell>铅封标记</CCell>
              <CCell colSpan={2}>{orc.铅封 || '／'}</CCell>
            </TableRow>
            <TableRow>
              <CCell>标牌号</CCell>
              <CCell>{orc.标牌号 || '／'}</CCell>
              <CCell>一品一码</CCell>
              <CCell colSpan={2}>{orc.一品码 || '／'}</CCell>
            </TableRow>
          </DirectLink>
        </TableBody>
      </Table>

  </React.Fragment>;
};

